home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk180 / arexxtutorial / more_examples / plot.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  4KB  |  119 lines

  1. /*    A Rexx plot program for PCLO       */
  2.  
  3. trace off
  4.  
  5. arg plotfile
  6. if plotfile = "" then
  7. do;
  8.     say "Usage: rx plot file.block"
  9.     say "Note: Only works on PCLO Block files, Board files are encrypted"
  10.     exit 10
  11. end; 
  12.  
  13.  
  14. image.0=copies('00'x,72)
  15. image.1=copies('3f 3f 3f 00'x,18)
  16.  
  17. image.2=('00 3f 00 00  00 3f 00 00  01 3e 00 00  03 3c 00 00'x)
  18. image.2=image.2||('07 08 00 00  0f 30 00 00  3f 80 03 00  3f 00 07 00'x)
  19. image.2=image.2||('3e 00 0f 00  3c 00 1f 00  38 00 3f 00  30 01 3f 00'x)
  20. image.2=image.2||('20 03 3c 00  00 07 38 00  00 0f 30 00  00 1f 20 00'x)
  21. image.2=image.2||('00 3f 00 00  00 3f 00 00'x)
  22.  
  23. image.3=('00 3f 00 00  00 3f 00 00  00 1f 20 00  00 0f 30 00'x)
  24. image.3=image.3||('00 07 38 00  20 03 3c 00  30 01 3f 00  38 00 3f 00'x)
  25. image.3=image.3||('3c 00 1f 00  3e 00 0f 00  3f 00 07 00  3f 80 03 00'x)
  26. image.3=image.3||('0f 30 00 00  07 08 00 00  03 3c 00 00  01 3e 00 00'x)
  27. image.3=image.3||('00 3f 00 00  00 3f 00 00'x)
  28.  
  29. image.4=copies('00 3f 00 00'x,18)
  30. image.5=copies('00'x,24)||copies('3f 3f 3f 00'x,6)||copies('00'x,24)
  31.  
  32. image.6=copies('00'x,24)
  33. image.6=image.6||('30 00 00 00  38 00 00 00  3c 00 00 00  3e 00 00 00'x)
  34. image.6=image.6||('3f 00 00 00  3f 20 00 00  0f 30 00 00  0e 38 00 00'x)
  35. image.6=image.6||('03 3c 00 00  01 3e 00 00  00 3f 00 00  00 3f 00 00'x)
  36.  
  37.  
  38. image.7=('00 3f 00 00  00 3f 00 00  00 1f 80 00  00 0f 30 00'x)
  39. image.7=image.7||('00 07 38 00  00 03 3c 00  00 01 3e 00  00 00 3f 00'x)
  40. image.7=image.7||('00 00 1f 00  00 00 0f 00  00 00 0e 00  00 00 03 00'x)
  41. image.7=image.7||copies('00'x,24)
  42.  
  43. image.9=copies('00'x,24)
  44. image.9=image.9||('00 00 03 00  00 00 0e 00  00 00 0f 00  00 00 1f 00'x)
  45. image.9=image.9||('00 00 3f 00  00 01 3e 00  00 03 3c 00  00 07 38 00'x)
  46. image.9=image.9||('00 0f 30 00  00 1f 80 00  00 3f 00 00  00 3f 00 00'x)
  47.  
  48. image.8=('00 3f 00 00  00 3f 00 00  01 3e 00 00 03 3c 00 00'x)
  49. image.8=image.8||('0e 38 00 00  0f 30 00 00  3f 20 00 00  3f 00 00 00'x)
  50. image.8=image.8||('3e 00 00 00  3c 00 00 00  38 00 00 00  30 00 00 00'x)
  51. image.8=image.8||copies('00'x,24)
  52.  
  53.  
  54. image.10=copies('00 3f 00 00'x,6)||copies('3f 3f 00 00'x,6)
  55.  image.10=image10||copies('00 3f 00 00'x,6)
  56.  
  57. image.12=copies('00 3f 00 00'x,6)||copies('00 3f 3f 00'x,6)
  58.  image.12=image.12||copies('00 3f 00 00'x,6)
  59.  
  60. image.11=copies('00 3f 00 00'x,6)||copies('3f 3f 3f 00'x,6)
  61.  image.11=image.11||copies('00'x,24)
  62.  
  63. image.13=copies('00'x,24)||copies('3f 3f 3f 00'x,6)||copies('00 3f 00 00'x,6)
  64.  
  65. image.14=copies('00 3f 00 00'x,6)||copies('3f 3f 3f 00'x,6)
  66.  image.14=image.14||copies('00 3f 00 00'x,6)
  67.  
  68. image.15=('00 3f 00 00  03 3f 30 00  0f 3f 3c 00  0f 3f 3c 00'x)
  69. image.15=image.15||('1f 3f 3e 00  1f 3f 3e 00  3f 3f 3f 00'x)
  70. image.15=image.15||copies('3f 21 3f 00'x,4)
  71. image.15=image.15||('3f 3f 3f 00  1f 3f 3e 00  1f 3f 3e 00'x)
  72. image.15=image.15||('0f 3f 3c 00  0f 3f 3c 00  03 3f 30 00  00 3f 00 00'x)
  73.  
  74. image.16=image.15
  75.  
  76. image.17=image.0
  77.  
  78. image.18=image.15
  79.  
  80. image.19=image.15
  81.  
  82.  
  83. if open(file,plotfile,Read)~=1 then
  84. do
  85.     say "Can't open source file"
  86.     exit
  87. end
  88. file=readch(file,60000)
  89.  
  90.  
  91. if open(printer,'par:',Write)~=1 then
  92. do
  93.     say "Can't open Parallel Port"
  94.     exit
  95. end
  96. writech(printer,"0d 1b 1e 06 0d 0a"x)
  97.  
  98. length=(c2d(substr(file,8,1))+1)*18
  99. length =right('0000'||length,4)
  100. blimit=(c2d(substr(file,8,1))+1)*2
  101.  
  102. alimit=(c2d(substr(file,4,1))+1)*blimit;
  103.  
  104. file=right(file,length(file)-7)
  105. do a=0 to alimit by blimit
  106. outstring="1b 3b"x||length
  107. do b=blimit to 2 by -2
  108. data = c2d(substr(file,a+b,1))
  109.  
  110. outstring=outstring||image.data
  111.  
  112. end b
  113.  
  114. outstring=outstring||"0a 0d"x
  115.  
  116. writech(printer,outstring)
  117.  
  118. end a
  119.